package demo1;

public enum Test {
    RED,BLACK,BLUE;
    public static void main(String[] args) {
        /**
         * 枚举类型可以搭配switch语句进行使用*/
        Test test = Test.BLACK;
        switch(test) {
            case RED:
                System.out.println("红色");
                break;
            case BLUE:
                System.out.println("蓝色");
                break;
            case BLACK:
                System.out.println("黑色");
                break;
            default:
                System.out.println("未找到匹配元素！");
                break;
        }
    }
}

